package com.neusoft.mybatisplustest.controller;

import com.neusoft.mybatisplustest.po.Dept;
import com.neusoft.mybatisplustest.service.DeptPlusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DeptPlusController {

    @Autowired
    DeptPlusService service;

    @RequestMapping("/getDeptPulss")
    public List<Dept> getDeptPulss() {
        return service.getDeptPulss();
    }

    @RequestMapping("/getDeptById")
    public Dept getDeptById(Integer deptno){
        return service.getDeptById(deptno);
    }

    @RequestMapping("/insertDept")
    public int insertDept(Dept dept){
        return service.insertDept(dept);
    }

    @RequestMapping("/updateDept")
    public int updateDept(Dept dept){
        return service.updateDept(dept);
    }

    @RequestMapping("/deleteDept")
    public int deleteDept(Integer deptno){
        return service.deleteDept(deptno);
    }
}
